import { AppRouteRecordRaw } from "../utils/utils";
import { RoutesAlias } from "../routesAlias";

/**
 * 静态路由配置
 * 不需要权限就能访问的路由
 */
export const staticRoutes: AppRouteRecordRaw[] = [
  {
    path: RoutesAlias.Login,
    name: "Login",
    component: () => import("@/views/auth/login.vue"),
    meta: { title: "menus.login.title", isHideTab: true, setTheme: true },
  },
  {
    path: RoutesAlias.Register,
    name: "Register",
    component: () => import("@views/auth/register/index.vue"),
    meta: {
      title: "menus.register.title",
      isHideTab: true,
      noLogin: true,
      setTheme: true,
    },
  },
  {
    path: RoutesAlias.ForgetPassword,
    name: "ForgetPassword",
    component: () => import("@views/auth/forget-password/index.vue"),
    meta: {
      title: "menus.forgetPassword.title",
      isHideTab: true,
      noLogin: true,
      setTheme: true,
    },
  },
  {
    path: "/exception",
    component: () => import("@views/index/index.vue"),
    name: "Exception",
    meta: { title: "menus.exception.title" },
    children: [
      {
        path: RoutesAlias.Exception403,
        name: "Exception403",
        component: () => import("@views/exception/403/index.vue"),
        meta: { title: "403" },
      },
      {
        path: "/:catchAll(.*)",
        name: "Exception404",
        component: () => import("@views/exception/404/index.vue"),
        meta: { title: "404" },
      },
      {
        path: RoutesAlias.Exception500,
        name: "Exception500",
        component: () => import("@views/exception/500/index.vue"),
        meta: { title: "500" },
      },
    ],
  },
  {
    path: "/outside",
    component: () => import("@views/index/index.vue"),
    name: "Outside",
    meta: { title: "menus.outside.title" },
    children: [
      {
        path: "/outside/iframe/:path",
        name: "Iframe",
        component: () => import("@/views/outside/Iframe.vue"),
        meta: { title: "iframe" },
      },
    ],
  },
  {
    path: "/test",
    component: () => import("@views/index/index.vue"),
    name: "Test",
    meta: { title: "测试页面" },
    children: [
      {
        path: "/test/wms-store",
        name: "WmsStoreTest",
        component: () => import("@/views/test/WmsStoreTest.vue"),
        meta: { title: "WMS状态管理测试" },
      },
    ],
  },
  {
    path: "/",
    component: () => import("@/views/index/index.vue"),
    name: "Root",
    redirect: "/dashboard/console",
    children: [
      {
        path: "/dashboard/console",
        name: "Dashboard",
        component: () => import("@/views/dashboard/console/index.vue"),
        meta: {
          title: "控制台",
          icon: "dashboard",
          isHide: false,
        },
      },
    ],
  },
];
